import axios from './axios';
// http 接口返回的内容基础结构
export declare interface ApiResponse<T = any> {
  code: number;
  msg?: string;
  data?: T;
}

// 通用列表返回结构
export interface HttpListResp<T> {
  current: number;
  records: T[];
  size: number;
  total: number;
}

class UserService {
  // 获取图片验证码
  static async getImageCode<T>() {
    return axios<ApiResponse<T>>({
      url: '/admin-api/v1/getImageCode',
      method: 'get',
    });
  }

  static userLogin<T = any>(data: any) {
    return axios<ApiResponse<T>>({
      url: `/admin-api/v1/login`,
      method: 'post',
      data,
    });
  }

  // 获取热门城市
  static getHotCityList<T = any>() {
    return axios<ApiResponse<T>>({
      url: `/admin-api/v1/selectPopularList`,
      method: 'get',
    });
  }

  // 获取行业分类
  static getHotHangYeList<T = any>() {
    return axios<ApiResponse<T>>({
      url: `/admin-api/v1/selectPositionTree`,
      method: 'get',
    });
  }
  // 上传分析简历
  static analResume<T = any>(data: any) {
    return axios<ApiResponse<T>>({
      url: `/admin-api/v1/pluginResumeUpload`,
      method: 'post',
      data,
    });
  }
}

export default UserService;
